package com.woniuxy.springaop;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

/**
 * @author: zhouhongcheng
 * Date: 2022/1/20:17:18
 * Description:
 */
public class MyAspectSpring implements MethodInterceptor {
    public void beforeInfo(){
        System.out.println("方法前执行！");
    }
    public void afterInfo(){
        System.out.println("方法后执行！");
    }
    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {
        beforeInfo();
        Object proceed = invocation.proceed();
        afterInfo();
        return proceed;
    }
}
